Skip to main content

๐Ÿ‘ Generate app code

The Relational Migrator allows you to generate application code in a variety of languages, derived from your MongoDB schema definition. While this code is not a full-blown app, it can save developers significant time compared to creating entity classes by hand.

Generate model classes for your collectionsโ€‹

  • At the top, switch to Code Generation tab
  • Under Language, select C# (or your preferred language)
  • Under Template, select Persistence Layer
  • Click each of the collections in the list. Notice the tabs containing entity classes and CRUD helpers for each collection or embedded object.

Generate JSON Schema filesโ€‹

  • Under Language, select `JSON'
  • Under Template, select Sample Documents. Notice how you can view examples of how data in each collection will be structured.
  • Under Template, select JSON Schema (MongoDB). Notice how you can view and download JSON Schema validators which could be used to enforce schema compliance.
Code generation tab